<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Target Material Design Bootstrap Admin Template</title>
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <link rel="stylesheet" href="/information/admin1/assets/materialize/css/materialize.min.css" media="screen,projection" />
    <!-- Bootstrap Styles-->
    <link href="/information/admin1/assets/css/bootstrap.css" rel="stylesheet" />
    <!-- FontAwesome Styles-->
    <link href="/information/admin1/assets/css/font-awesome.css" rel="stylesheet" />
    <!-- Morris Chart Styles-->
    <link href="/information/admin1/assets/js/morris/morris-0.4.3.min.css" rel="stylesheet" />
    <!-- Custom Styles-->
    <link href="/information/admin1/assets/css/custom-styles.css" rel="stylesheet" />
    <!-- Google Fonts-->
    <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
    <link rel="stylesheet" href="/information/admin1/assets/js/Lightweight-Chart/cssCharts.css">
</head>

<body>
<div id="wrapper">
    <nav class="navbar navbar-default top-navbar" role="navigation">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle waves-effect waves-dark" data-toggle="collapse" data-target=".sidebar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand waves-effect waves-dark" href="index.html"><i class="large material-icons">track_changes</i> <strong>产品供求信息网</strong></a>

            <div id="sideNav" href=""><i class="material-icons dp48">toc</i></div>
        </div>

        <ul class="nav navbar-top-links navbar-right">
            <li><a class="dropdown-button waves-effect waves-dark" href="#!" data-activates="dropdown1"><i class="fa fa-user fa-fw"></i> <b>个人中心</b> <i class="material-icons right">arrow_drop_down</i></a></li>
        </ul>
    </nav>
    <!-- Dropdown Structure -->
    <ul id="dropdown1" class="dropdown-content">
        <li><a href="#"><i class="fa fa-user fa-fw"></i> 个人中心</a>
        </li>
        <li><a href="/information/login.html"><i class="fa fa-sign-out fa-fw"></i> 登出</a>
        </li>
    </ul>

    <!--/. NAV TOP  -->
    <nav class="navbar-default navbar-side" role="navigation">
        <div class="sidebar-collapse">
            <ul class="nav" id="main-menu">

                <li>
                    <a href="index.html"  class="waves-effect waves-dark"> 首页</a>
                </li>
                <li>
                    <a href="infoshow.html" class="waves-effect waves-dark"> 产品信息查询</a>
                </li>
                <li>
                    <a class="active-menu waves-effect waves-dark" href="infocreate.html"> 产品信息发布</a>
                </li>
                <li>
                    <a href="myProfile.html" class="waves-effect waves-dark"> 个人中心</a>
                </li>
            </ul>

        </div>

    </nav>
    <!-- /. NAV SIDE  -->

    <div id="page-wrapper">
        <div class="header">
            <h1 class="page-header">
                产品信息发布
            </h1>
<!--            <ol class="breadcrumb">-->
<!--                <li><a href="#">Home</a></li>-->
<!--                <li><a href="#">Dashboard</a></li>-->
<!--                <li class="active">Data</li>-->
<!--            </ol>-->

        </div>
        <div id="page-inner">

            <div class="row">
                <div class="col-md-12">
                    <!-- Advanced Tables -->
                    <div class="card">

                        <div class="card-action">
                            我已发布的产品信息
                        </div>

                        <div class="card-content">
                            <div class="row">
                            <div class=" col s2">
                                <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#newinfoModal">发布产品信息</button><button type="button" class="btn btn-primary" data-toggle="modal" data-target="#newvipinfoModal">发布推荐产品信息</button>
                            </div>
                            </div>
                            <div class="table-responsive table-bordered">
                                <table class="table" id="dataTables-example">
                                    <thead>
                                    <tr>
                                        <th>产品标题</th>
                                        <th>产品类型</th>
                                        <th>发布人</th>
                                        <th>发布时间</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody id="databody">
                                    </tbody>
                                </table>
                            </div>

                        </div>
                    </div>
                    <!--End Advanced Tables -->
                </div>
            </div>
        </div>
        <!-- /. PAGE INNER  -->
    </div>
    <!-- /. PAGE WRAPPER  -->
</div>

<!--/. positionDetailModal  -->
<div class="modal fade" id="newinfoModal">
    <div class="modal-dialog">
        <div class="modal-content">

            <div class="modal-header">
                <h4 class="modal-title">产品信息发布</h4>
            </div>

            <div class="modal-body">
                <form id="positionFrm2" action="/information/info/addInfo" target="frame1" method="POST" enctype="multipart/form-data">
                    <div class="form-group">
                        <label >信息标题:</label>
                        <input type="text" class="form-control" name="titleinput">
                    </div>
                    <div class="form-group">
                        <label>信息详细内容:</label>
                        <textarea class="form-control" rows="5" name="contentinput"></textarea>
                    </div>
                    <div class="form-group">
                        <label >产品类型:</label>
                        <input type="text" class="form-control" name="producttypeinput">
                    </div>
                    <div class="form-group">
                        <label >联系电话:</label>
                        <input type="text" class="form-control" name="mobileinput">
                    </div>
                    <div class="form-group">
                        <label >联系人微信:</label>
                        <input type="text" class="form-control" name="wechatinput">
                    </div>
                    <div class="form-group">
                        <label >联系人QQ:</label>
                        <input type="text" class="form-control" name="qqinput">
                    </div>
                    <div class="form-group">
                        <label >价格:</label>
                        <input type="text" class="form-control" name="priceinput">
                    </div>
                    <div class="form-group">
                        <label >供求情况:</label>
                        <input type="text" class="form-control" name="sdinput" placeholder="提供/求购">
                    </div>
                    <div class="form-group">
                        <label >上传图片:</label>
                        <input type="file" name="file"/>
                    </div>
                </form>
            </div>

            <div class="modal-footer">
                <button type="button" class="btn btn-primary" onclick="upload()">提交</button>
                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
            </div>

        </div>
    </div>
</div>
<!--End positionDetailModal -->

<!--/. positionDetailModal  -->
<div class="modal fade" id="updateModal">
    <div class="modal-dialog">
        <div class="modal-content">

            <div class="modal-header">
                <h4 class="modal-title">产品信息发布</h4>
            </div>

            <div class="modal-body">
                <form id="positionFrm3" action="/information/info/updateInfo" target="frame1" method="POST" enctype="multipart/form-data">
                    <input type="hidden" class="form-control" name="updatetid" >
                    <input type="hidden" class="form-control" name="updatetime" >
                    <input type="hidden" class="form-control" name="updateimage" >
                    <div class="form-group">
                        <label >信息标题:</label>
                        <input type="text" class="form-control" name="updatetitle" >
                    </div>
                    <div class="form-group">
                        <label>信息详细内容:</label>
                        <textarea class="form-control" rows="5" name="updatecontent"></textarea>
                    </div>
                    <div class="form-group">
                        <label >产品类型:</label>
                        <input type="text" class="form-control" name="updateproducttype">
                    </div>
                    <div class="form-group">
                        <label >联系电话:</label>
                        <input type="text" class="form-control" name="updatemobile">
                    </div>
                    <div class="form-group">
                        <label >联系人微信:</label>
                        <input type="text" class="form-control" name="updatewechat">
                    </div>
                    <div class="form-group">
                        <label >联系人QQ:</label>
                        <input type="text" class="form-control" name="updateqq">
                    </div>
                    <div class="form-group">
                        <label >价格:</label>
                        <input type="text" class="form-control" name="updateprice">
                    </div>
                    <div class="form-group">
                        <label >供求情况:</label>
                        <input type="text" class="form-control" name="updatesd">
                    </div>
                    <div class="form-group">
                        <label >上传图片:</label>
                        <input type="file" name="file"/>
                    </div>
                </form>
            </div>

            <div class="modal-footer">
                <button type="button" class="btn btn-primary" onclick="upload2()">提交</button>
                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
            </div>

        </div>
    </div>
</div>

<div class="modal fade" id="moreModal">
    <div class="modal-dialog">
        <div class="modal-content">

            <div class="modal-header">
                <h4 class="modal-title">详情</h4>
            </div>
            <table>
                <tbody id="morebody">

                </tbody>
            </table>
            <div class="modal-body">
            </div>

            <div class="modal-footer">
                <a href="infocreate.html"><button>关闭</button></a>
            </div>

        </div>
    </div>
</div>

<div class="modal fade" id="newvipinfoModal">
    <div class="modal-dialog">
        <div class="modal-content">

            <div class="modal-header">
                <h4 class="modal-title">推荐产品信息发布</h4>
            </div>

            <div class="modal-body">
                <form id="positionFrm4" action="/information/info/addvipInfo" target="frame1" method="POST" enctype="multipart/form-data">
                    <div class="form-group">
                        <label >信息标题:</label>
                        <input type="text" class="form-control" name="titleinput">
                    </div>
                    <div class="form-group">
                        <label>信息详细内容:</label>
                        <textarea class="form-control" rows="5" name="contentinput"></textarea>
                    </div>
                    <div class="form-group">
                        <label >产品类型:</label>
                        <input type="text" class="form-control" name="producttypeinput">
                    </div>
                    <div class="form-group">
                        <label >联系电话:</label>
                        <input type="text" class="form-control" name="mobileinput">
                    </div>
                    <div class="form-group">
                        <label >联系人微信:</label>
                        <input type="text" class="form-control" name="wechatinput">
                    </div>
                    <div class="form-group">
                        <label >联系人QQ:</label>
                        <input type="text" class="form-control" name="qqinput">
                    </div>
                    <div class="form-group">
                        <label >价格:</label>
                        <input type="text" class="form-control" name="priceinput">
                    </div>
                    <div class="form-group">
                        <label >供求情况:</label>
                        <input type="text" class="form-control" name="sdinput" placeholder="提供/求购">
                    </div>
                    <div class="form-group">
                        <label >上传图片:</label>
                        <input type="file" name="file"/>
                    </div>
                </form>
            </div>

            <div class="modal-footer">
                <button type="button" class="btn btn-primary" onclick="upload3()">提交</button>
                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
            </div>

        </div>
    </div>
</div>

<!-- /. WRAPPER  -->
<!-- JS Scripts-->
<!-- jQuery Js -->
<script src="/information/admin1/assets/js/jquery-1.10.2.js"></script>

<!-- Bootstrap Js -->
<script src="/information/admin1/assets/js/bootstrap.min.js"></script>

<!--<script src="/information/admin1/assets/materialize/js/materialize.min.js"></script>-->

<!-- Metis Menu Js -->
<script src="/information/admin1/assets/js/jquery.metisMenu.js"></script>
<!-- Morris Chart Js -->
<script src="/information/admin1/assets/js/morris/raphael-2.1.0.min.js"></script>
<script src="/information/admin1/assets/js/morris/morris.js"></script>


<script src="/information/admin1/assets/js/easypiechart.js"></script>
<script src="/information/admin1/assets/js/easypiechart-data.js"></script>

<script src="/information/admin1/assets/js/Lightweight-Chart/jquery.chart.js"></script>

<!--&lt;!&ndash; DATA TABLE SCRIPTS &ndash;&gt;-->
<!--<script src="/information/admin1/assets/js/dataTables/jquery.dataTables.js"></script>-->
<!--<script src="/information/admin1/assets/js/dataTables/dataTables.bootstrap.js"></script>-->



<script src="/information/js/infocreate.js"></script>
<iframe name="frame1" frameborder="0" height="40"></iframe>
<script type="text/javascript">
    function upload() {
        $("#positionFrm2").submit();
        location.reload();

    }
        function upload2() {
        $("#positionFrm3").submit();
        location.reload();
    }
    function upload3() {
    $.getJSON("/information/user/userinfo", function(json){
                   if(json.data.role!="1"){
                       alert("您还不是vip用户！不能发布推荐信息！")
                       $(location).attr("href", "infocreate.html");
                       }else{
                             $("#positionFrm4").submit();
                             location.reload();
                       }
                   })

    }
</script>
<!--<script>-->
<!--$(document).ready(function () {-->
<!--    $('#dataTables-example').dataTable();-->
<!--});-->
<!--</script>-->
<!-- Custom Js -->
<script src="/information/admin1/assets/js/custom-scripts.js"></script>
</body>

</html>